<include file="public/header" />
<include file="public/left" />
<style>
    img:hover{;position:fixed;top:100px;width:auto;height: 80%;z-index: 999;}
</style>
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title"><a class="back" href="javascript:history.back();" title="返回列表">返回上一页</a>
            <div class="subject">
                <h3>司机详情</h3>
                <h5>路线管理</h5>
            </div>
        </div>
    </div>
    <form class="form-horizontal" id="adminHandle" method="post">
        <input type="hidden" name="id" value="{$data.id}">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">路线：</dt>
                <dd class="opt">
                    <!--<textarea id="line" name="line" class="tarea" rows="6"> {$data.line}</textarea>-->
                    <!--<span></span>-->
                    <volist name="route" id="vo">
                        <input type="radio" name="line" value="{$vo.route_sn}" <if condition="$vo.route_sn==$data.line">checked</if>><a href="{:url('Set/routedetail',array('sn'=>$vo.route_sn))}">{$vo.route_sn}</a>
                    </volist>


                    <p class="notic"></p>
                </dd>
            </dl>
            <div class="bot">
                <input type="button" class="link_btn" data-url="{:url('Driver/setline')}" value="保存" driver_id="{$data.id}" onclick="checkid(this)"/>
            </div>
        </div>

    </form>
</div>
<script type="text/javascript">
    function checkid(obj) {
        var line = $("input[name='line']:checked").val();
        // 删除按钮
        var confirm='是否确定修改路线';
        layer.confirm(confirm, {
            btn: ['确定', '取消'] //按钮
        }, function () {
            $.ajax({
                type: 'post',
                url: $(obj).attr('data-url'),
                data : {id:$(obj).attr('driver_id'),line:line},
                dataType: 'json',
                success: function (data) {
                    if (data.code == 1) {
                        var index = layer.alert(data.msg, {
                            closeBtn: 0
                        }, function(){
                            document.location = data.url;
                        });
                    } else {
                        layer.alert('操作失败', {icon: 2});
                    }
                }
            })
        }, function () {
        });
    }
</script>
</body>
</html>
